package com.mym.test;

import java.util.Arrays;

/**
 * @author miao
 * @version 1.0
 * @date 2025/4/10 11:29
 * @description
 */
public class ArrsysinterImpl implements Arraysinter {

    @Override
    public boolean equals(int[] arr1, int[] arr2) {
        int i=0;
        while (true){
            if (arr1[i]==arr2[i]){

            }else {
                return false;
            }
            i++;
            return true;
        }

    }

    @Override
    public void fill(int[] arr, int element) {
        for (int i = 0; i < arr.length; i++) {
            arr[i]=element;
            System.out.println(Arrays.toString(arr));
        }

    }

    @Override
    public void sort(int[] arr) {
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-i; j++) {
                if (arr[i]<arr[i+1]){
                    int temp=arr[i];
                    arr[i]=arr[i+1];
                    arr[i+1]=temp;
                }
            }
            System.out.println(Arrays.toString(arr));
        }

    }

    @Override
    public int binarySearch(int[] arr, int element) {
        System.out.println(Arrays.binarySearch(arr, element));
        return 0;
    }
}
